package com.czk.service;

import org.kie.api.KieBase;
import org.kie.api.cdi.KBase;
import org.kie.api.runtime.KieSession;
import org.springframework.stereotype.Service;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/8/24 22:21
 */
@Service
public class RuleService {
    @KBase("kbase") // 注入kbase对象
    private KieBase kieBase;

    public void rule() {
        KieSession kieSession = kieBase.newKieSession();
        kieSession.fireAllRules();
        kieSession.dispose();
    }
}
